#!/sbin/openrc-run

description="Jackal is a server for jackal/XMPP written in Go."

: ${cfgfile:="/etc/jackal/config.yml"}

command="/usr/bin/jackal"
command_args="--config $cfgfile $command_args"
command_background=yes
pidfile="/run/$RC_SVCNAME.pid"
directory="/var/lib/jackal"
error_logger="logger -t jackal -p daemon.info >/dev/null 2>&1"

required_files="$cfgfile"

start_pre() {
	checkpath -d -m 0750 -o jackal:jackal /var/log/jackal
}
